<?php

use yii\db\Migration;

/**
 * Handles the creation of table `package_review`.
 */
class m171026_084855_create_package_application_table extends Migration
{
    /**
     * @inheritdoc
     * 资产包相关审批记录表
     */
    public function up()
    {
        $this->createTable('package_application', [
            'id' => $this->bigPrimaryKey(),
            'package_id' => $this->bigInteger()->notNull(),
            'type' => $this->smallInteger()->notNull()->comment('审批名称'),//1立项审批 2投资审批 3盘活审批 4处置审批 5申请访问
            'proposer' => $this->integer()->notNull()->comment('申请人'),
            'applied_at' => $this->timestamp()->comment('申请时间'),
            'reason' => $this->text()->comment('申请理由'),
            'workflow_status' => $this->smallInteger()->defaultValue(1)->comment('审批进程'),//1进行中 2完成
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('package_review');
    }
}
